package com.itheima.wisdomnext.entity.Result.enumcalss;

public enum ErrorCode {

    SUCCESS(200, "成功"),
    FAILED(300, "失败"),
    PARAMS_VALID_ERROR(310, "参数校验错误"),
    PARAMS_TYPE_ERROR(311, "参数类型错误"),
    REQUEST_METHOD_ERROR(312, "请求方法错误"),
    ASSERT_ARGUMENT_ERROR(313, "断言参数错误"),
    ASSERT_MYBATIS_ERROR(314, "断言Mybatis错误"),

    LOGIN_ACCOUNT_ERROR(330, "登录账号或密码错误"),
    LOGIN_DISABLE_ERROR(331, "登录账号已被禁用了"),
    TOKEN_EMPTY(332, "token参数为空"),
    TOKEN_INVALID(333, "token参数无效"),
    CAPTCHA_ERROR(334, "验证码错误"),
    PAYMENT_ERROR(335, "发起支付失败"),

    BIND_RELATION_ERROR(340, "绑定关系失败"),

    NO_PERMISSION(403, "无相关权限"),
    REQUEST_404_ERROR(404, "请求接口不存在"),

    SYSTEM_ERROR(500, "系统错误"),

    PARAMS_ERROR(40000, "请求参数错误"),
    NO_AUTH_ERROR(40101, "无权限");


    private final int code;
    private final String msg;

    /**
     * @Description: 构造方法
     * @CreateTime: 2024/11/26
     */
    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * @Description: 获取状态码
     * @CreateTime: 2024/11/26
     */
    public int getCode() {
        return this.code;
    }

    /**
     * @Description: 获取提示
     * @CreateTime: 2024/11/26
     */
    public String getMsg() {
        return this.msg;
    }
}
